package com.softWang.system.po;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.softWang.common.base.BasePO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
 * <p>
 * 系统管理--租户表
 * </p>
 */
@TableName(value = "system_tenant", autoResultMap = true)
@KeySequence("system_tenant_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
public class SystemTenant  extends BasePO {

    @ApiModelProperty(value = "id,长度19")
    @TableId
    private Long id;

    @ApiModelProperty(value = "租户名,长度40")
    private String tname;

    @ApiModelProperty(value = "类型，1:系统租户 2:普通租户,长度3")
    private Integer type;

    @ApiModelProperty(value = "联系人,长度10")
    private String contactName;

    @ApiModelProperty(value = "联系人手机,长度30")
    private String contactMobile;

    @ApiModelProperty(value = "状态，0:正常,1:停用,长度3")
    private Integer state;

    /**
     * 类型枚举
     */
    public enum Type {
        /**
         * 系统租户
         */
        SYSTEM(1),
        /**
         * 普通租户
         */
        COMMON(2);


        private Integer code;

        Type(Integer code) {
            this.code = code;
        }
        public Integer getCode() {
            return this.code;
        }
    }


}
